package com.f21.f21assessoria.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.FacesConverter;

import com.f21.f21assessoria.enums.Status;

@FacesConverter(value = "StatusConverter")
//@FacesConverter(forClass= Status.class)
public class StatusConverter extends TemplateConverterEnum {

	public Object getAsObject(FacesContext context, UIComponent component,
			String value) {

		for (Status s : Status.values()) {
			if (s.getLabel().equalsIgnoreCase(value))
				return s.getValue();
		}

		return null;
	}

}
